﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="CadastroFuncionario.aspx.cs" Inherits="SisVenda.Web.Restrito.CadastroFuncionario" %>

<%@ OutputCache Location="None" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<script type="text/javascript">
/*
* Corrige posição do calendar extender no IE (AjaxToolKit)
*/
function CorrigePosicaoCalendarIE(idElemento, alturaInput) {
    $('input[id*="tbxDataNasci_CalendarExtender"]').click(function() {
        ResistrarInterval($(this), alturaInput);
    });

    $('input[id*="tbxDataNasci_CalendarExtender"]').focus(function() {
        ResistrarInterval($(this), alturaInput);
    });
}

function ResistrarInterval(campo, alturaInput) {
    var intervalo = window.setInterval(function() {
        if ($(".ajax__calendar_container").is(":visible")) {
            $(".ajax__calendar_container").css('left', $(campo).position().left + 0);
            $(".ajax__calendar_container").css('top', $(campo).position().top + alturaInput);
            clearInterval(intervalo);
        }
    }, 50);
</script>


  <asp:Panel ID="pnlListagem" runat="server" GroupingText="Tipos de Mensagem" DefaultButton="btnPesquisar"
        SkinID="Pesquisa">
        <table class="filtros">
            <tr>
              <td class="rotuloFiltro">
                    CPF:
                </td>
                <td>
                    <asp:TextBox runat="server" ID="tbxFunc_Cpf" ValidationGroup="Pesquisa" SkinID="Cpf"
                        MaxLength="18"></asp:TextBox>
                    <act:MaskedEditExtender ID="tbxFunc_Cpf_MaskedEditExtender" runat="server" 
                        CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" SkinID="Cpf"
                        CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" 
                        CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" 
                        TargetControlID="tbxFunc_Cpf">
                    </act:MaskedEditExtender>
                </td>
                <td class="rotuloFiltro">
                    Nome:
                </td>
                <td>
                    <asp:TextBox runat="server" ID="tbxCle_Nome" MaxLength="70" ValidationGroup="Pesquisa"
                        Width="200px"></asp:TextBox>
                </td>
                <td align="center">
                    Linhas:&nbsp;
                    <asp:DropDownList ID="ddlConsulta" runat="server" SkinID="Paginacao" OnSelectedIndexChanged="ddlConsulta_SelectedIndexChanged"
                        AutoPostBack="True">
                    </asp:DropDownList>
                </td>
                <td align="right">
                    <asp:Button ID="btnPesquisar" runat="server" OnClick="btnPesquisar_Click" Text="Pesquisar"
                        CausesValidation="False" SkinID="Pesquisar" />
                </td>
            </tr>
        </table>
         <asp:GridView ID="gvwFuncionario" runat="server" AllowPaging="True" AllowSorting="True"
            AutoGenerateColumns="False" DataSourceID="odsFuncionario" SkinID="SemSelect"
            ondatabinding="gvwFuncionario_DataBinding" DataKeyNames="pes_id" 
            onselectedindexchanged="gvwFuncionario_SelectedIndexChanged">
            <Columns>
                   <asp:TemplateField ShowHeader="False">
                             <ItemStyle HorizontalAlign="Center" Width="25px" CssClass="PaddingGridView" />
                             <HeaderStyle CssClass="PaddingGridViewHeader" />
                             <ItemTemplate>
                            <asp:ImageButton ID="ibnSelect" runat="server" CommandName="Select" CausesValidation="False"
                            SkinID="Select" />
                      </ItemTemplate>
                    </asp:TemplateField>
                  <asp:BoundField DataField="pes_id" HeaderText="Código" />
                  <asp:BoundField DataField="pes_nome" HeaderText="Nome do Funcionário" />
                  <asp:BoundField DataField="pes_cpf" HeaderText="CPF" />
                  <asp:BoundField DataField="pes_telefone" HeaderText="Telefone" />
                  <asp:BoundField DataField="pes_celular" HeaderText="Celular" />
                  <asp:BoundField DataField="pes_email" HeaderText="Email" />
                  <asp:BoundField DataField="car_descricao" HeaderText="Cargo" />
            </Columns>
            
            </asp:GridView>
        <asp:ObjectDataSource ID="odsFuncionario" runat="server" 
            OldValuesParameterFormatString="original_{0}" SelectMethod="ObterFuncionario" 
            TypeName="SisVenda.Web.Restrito.Fn.CadastroFucionarioFn" 
            onselecting="odsFuncionario_Selecting">
            <SelectParameters>
                <asp:ControlParameter ControlID="tbxCle_Nome" Name="nome" PropertyName="Text" 
                    Type="String" />
                <asp:ControlParameter ControlID="tbxFunc_Cpf" Name="cpf" PropertyName="Text" 
                    Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>
    </asp:Panel>
  <asp:Panel ID="pnlDados" runat="server" GroupingText="Dados do Funcionário">
     <asp:UpdatePanel ID="upnlEdicao" runat="server">
        <ContentTemplate>
          
            <asp:FormView ID="fvwEdicao" runat="server" DataSourceID="odsFormView">
                <ItemTemplate>
                <div>
                <asp:Panel ID="pnlExibir" runat="server" GroupingText="Exibição">
                  <table width="100%">
                      <tr>
                         <td>
                             CPF:
                             <br />
                             <asp:Label ID="lblCpf" runat="server" Text='<%# Eval("pes_cpf") %>' />
                         </td>
                         <td>
                             Nome:
                             <br />
                             <asp:Label ID="lblINome" runat="server" Text='<%# Eval("pes_nome") %>' />
                         </td>
                         <td>
                             RG:
                             <br />
                             <asp:Label ID="lblIRG" runat="server" Text='<%# Eval("pes_rg") %>' />
                         </td>
                         <td>
                             Sexo:
                             <br />
                             <asp:Label ID="lblISexo" runat="server" Text='<%# Eval("pes_sexo") %>' />
                         </td>
                         <td>
                            Data Nascimento:
                            <br />
                           <asp:Label ID="lblIDataNasc" runat="server" Text='<%# Eval("pes_dataNascimento") %>' />
                         </td>
                      </tr>
                  </table>    
                  <table width="100%">
                    <tr>
                       <td>
                          Endereço:
                          <br />
                         <asp:Label ID="lblIEndereco" runat="server" Text='<%# Eval("end_descricao") %>' />
                       </td>
                       <td>
                          N°:
                          <br />
                         <asp:Label ID="lblInumero" runat="server" Text='<%# Eval("end_numero") %>' />
                       </td>
                       <td>
                         Bairro:
                         <br/>
                         <asp:Label ID="lblIBairro" runat="server" Text='<%# Eval("end_bairro") %>' />
                       </td>
                       <td>
                         UF:
                         <br />
                         <asp:Label ID="lblIUF" runat="server" Text='<%# Eval("uf_nome") %>' />
                       </td>
                       <td>
                         Cidade:
                         <br/>
                          <asp:Label ID="lblICidade" runat="server" Text='<%# Eval("cid_cidade") %>'  />
                       </td>
                    </tr>
                    </table>
                 <table width="100%">
                    <tr>
                       <td>
                        CEP:
                        <br />
                        <asp:Label ID="lblIcep"  runat="server" Text='<%# Eval("end_cep") %>' />
                        </td>
                         <td>
                         Estado Civil:
                         <br />
                         <asp:Label ID="lblIEstadoCivil" runat="server" Text='<%# Eval("pes_estadoCivil") %>' />
                       </td>
                       <td>
                         Telefone:
                         <br />
                         <asp:Label ID="lblITelefone" runat="server" Text='<%# Eval("pes_telefone") %>'/>
                     </td>
                     <td>
                       Celular:
                         <br />
                         <asp:Label ID="lblICelular" runat="server" Text='<%# Eval("pes_celular") %>'/>
                     </td>
                     <td>
                       Fax:
                         <br />
                         <asp:Label ID="lblIFax" runat="server" Text='<%# Eval("pes_fax") %>'/>
                     </td>
                     <td>
                        Email:
                        <br />
                        <asp:Label ID="lblIEmail" runat="server" Text='<%# Eval("pes_email") %>' />
                     </td>
                     </tr>
                  </table> 
                 <table width="40%">
                     <tr>
                       <td>
                         Cargo:
                         <br/>
                         <asp:Label ID="lblAICargo" runat="server" Text='<%# Eval("car_descricao") %>' />
                       </td>
                       <td>
                         Carga Horária:
                         <br/>
                         <asp:Label ID="lblICarg" runat="server" Text='<%# Eval("car_cargaHoraria") %>' />
                       </td>
                       <td>
                         Sálario Base:
                         <br/>
                         <asp:Label ID="lblISal" runat="server" Text='<%# Eval("car_salarioBase") %>' />
                       </td>
                     </tr>
                  </table>
                </asp:Panel>
                </div>
                <div class="acoes">
                                &nbsp;<asp:Button ID="btnAlterarItem" runat="server" SkinID="Alterar" CommandName="Edit"
                                    Text="Alterar" Style="cursor: pointer;" />
                                &nbsp;<asp:Button ID="btnExcluirItem" runat="server" CommandName="Delete" SkinID="Excluir"
                                    Text="Excluir" Style="cursor: pointer;" />
                                &nbsp;<asp:Button ID="btnNovoItem" runat="server" CommandName="New" SkinID="Novo"
                                    Text="Novo" Style="cursor: pointer;" />
                            </div>
                </ItemTemplate>
                <EditItemTemplate>
                  <asp:Panel ID="pnlAlteracao" runat="server" GroupingText="Alterar">
                   <table width="100%">
                    <tr>
                          <td>
                          <asp:Label ID="lblidup" runat="server" Text='<%# Eval("pes_id") %>' Visible="false"></asp:Label>
                          <asp:Label ID="lblendidup" runat="server" Text='<%# Eval("end_id") %>' Visible="false"></asp:Label>
                           <asp:Label ID="lblCPF" runat="server" Text="CPF:"></asp:Label>
                              <br/>
                              <asp:TextBox ID="tbxACPF" runat="server" Text='<%# Eval("pes_cpf") %>' SkinID="Cpf"></asp:TextBox>
                              <ajaxToolkit:MaskedEditExtender ID="tbxCPFup_MaskedEditExtender" runat="server" 
                                  CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" SkinID="Cpf"
                                  CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" 
                                  CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" 
                                  TargetControlID="tbxACPF">
                              </ajaxToolkit:MaskedEditExtender>
                          </td>
                          <td>
                            <asp:Label ID="lblANome" runat="server" Text="Nome:"></asp:Label>
                              <br/>
                              <asp:TextBox ID="tbxANome" runat="server" Text='<%# Eval("pes_nome") %>' SkinID="Nome"></asp:TextBox>
                          </td>
                          <td>
                            <asp:Label ID="lblARg" runat="server" Text="RG:" />
                         <br />
                            <asp:TextBox ID="tbxARG" runat="server" Text='<%# Eval("pes_rg") %>' SkinID="RG"></asp:TextBox>
                        </td>
                          <td>
                            <asp:Label ID="lblASexo" runat="server" Text="Sexo:" />
                            <br />
                            <asp:DropDownList ID="ddlASexo" runat="server" SkinID="SEXO" SelectedValue='<%# Eval("pes_sexo") %>'>
                                <asp:ListItem Value="F">Feminino</asp:ListItem>
                                <asp:ListItem Value="M">Masculino</asp:ListItem>
                                
                            </asp:DropDownList>
                         </td>
                          <td>
                            <asp:Label ID="lblADataNasc" runat="server" Text="Data Nascimento:" />
                            <br />
                            <asp:TextBox ID="tbxADataNasci" runat="server" Text='<%# Eval("pes_dataNascimento") %>' SkinID="Data"></asp:TextBox>
                             <act:CalendarExtender ID="tbxADataNasci_CalendarExtender" runat="server" 
                                 Enabled="True" TargetControlID="tbxADataNasci" Format="dd/MM/yyyy">
                             </act:CalendarExtender>
                        </td>
                   </tr>
                   </table>
                   <table width="100%">
                    <tr>
                        <td>
                            <asp:Label ID="lblAEndereco" runat="server" Text="Endereço:" />
                            <br />
                            <asp:TextBox ID="tbxAEndereco" runat="server" Text='<%# Eval("end_descricao") %>' SkinID="Nome"></asp:TextBox>
                        </td>
                        <td>
                            <asp:Label ID="lblAnumero" runat="server" Text="N°:" />
                            <br />
                            <asp:TextBox ID="tbxANumero" runat="server" Text='<%# Eval("end_numero") %>' SkinID="NumeroPequeno"></asp:TextBox>
                        </td>
                        <td>
                            <asp:Label ID="lblABairro" runat="server" Text="Bairro:" />
                            <br />
                            <asp:TextBox ID="tbxABairro" runat="server" Text='<%# Eval("end_bairro") %>' SkinID="Nome"></asp:TextBox>
                        </td>
                        <td>
                            <asp:Label ID="lblUF" runat="server" Text="UF:" />
                            <br />
                            <asp:DropDownList ID="ddlAUF" runat="server" AutoPostBack="True" SelectedValue='<%# Eval("uf_nome") %>'
                                DataSourceID="odsufup" DataTextField="uf_nome" DataValueField="uf_nome" 
                                onselectedindexchanged="ddlUFA_SelectedIndexChanged" SkinID="UF" >
                            </asp:DropDownList>

                            <asp:ObjectDataSource ID="odsufup" runat="server" 
                                OldValuesParameterFormatString="original_{0}" SelectMethod="ObterUF" 
                                TypeName="SisVenda.Web.Restrito.Fn.CadastroPessoaFisicaFn">
                            </asp:ObjectDataSource>

                        </td>
                        <td>
                            <asp:Label ID="lblCidade" runat="server" Text="Cidade:" />
                            <br />
                            <asp:DropDownList ID="ddlACidade" runat="server" AutoPostBack="True" 
                                DataSourceID="odscidadeup" DataTextField="cid_cidade" 
                                DataValueField="cid_id" SkinID="Cidade">
                            </asp:DropDownList>
                            <asp:ObjectDataSource ID="odscidadeup" runat="server" 
                                OldValuesParameterFormatString="original_{0}" SelectMethod="ObterCidadeUF" 
                                TypeName="SisVenda.Web.Restrito.Fn.CadastroPessoaFisicaFn">
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="ddlAUF" Name="uf_nome" 
                                        PropertyName="SelectedValue" Type="String" />
                                </SelectParameters>
                            </asp:ObjectDataSource>
                        </td>
                     </tr>
                   
                  </table>
                   <table width="100%">
                 <tr>  
                  <td>
                          <asp:Label ID="lblAcep"  Text="Cep:" runat="server"></asp:Label>
                          <br />
                          <asp:TextBox ID="tbxACep" runat="server" Text='<%# Eval("end_cep") %>' SkinID="CEP"></asp:TextBox>
                        </td>
                     <td>
                      <asp:Label ID="lblAEstadoCivil" runat="server" Text="Estado Civil:" />
                            <br />
                      <asp:DropDownList ID="ddlAEstadoCivil" runat="server" SkinID="EstadoCivil" SelectedValue='<%# Eval("pes_estadoCivil") %>' >
                      </asp:DropDownList>
                     </td>
                     <td>
                        <asp:Label ID="lblATelefone" runat="server" Text="Telefone:"></asp:Label>
                         <br />
                         <asp:TextBox ID="tbxATelefone" runat="server" Text='<%# Eval("pes_telefone") %>' SkinID="Telefone"></asp:TextBox>
                         <act:MaskedEditExtender ID="tbxATelefone_MaskedEditExtender" runat="server" 
                             CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" SkinID="Fone"
                             CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" 
                             CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" 
                             TargetControlID="tbxATelefone">
                         </act:MaskedEditExtender>
                     </td>
                     <td>
                        <asp:Label ID="lblACelular" runat="server" Text="Celular:"></asp:Label>
                         <br />
                         <asp:TextBox ID="tbxACeluar" runat="server" Text='<%# Eval("pes_celular") %>' SkinID="Telefone"></asp:TextBox>
                         <act:MaskedEditExtender ID="tbxACeluar_MaskedEditExtender" runat="server" 
                             CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" SkinID="Fone"
                             CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" 
                             CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" 
                             TargetControlID="tbxACeluar">
                         </act:MaskedEditExtender>
                     </td>
                     <td>
                        <asp:Label ID="lblAFax" runat="server" Text="Fax:"></asp:Label>
                         <br />
                         <asp:TextBox ID="tbxAFax" runat="server" Text='<%# Eval("pes_fax") %>' SkinID="Telefone"></asp:TextBox>
                         <act:MaskedEditExtender ID="tbxAFax_MaskedEditExtender" runat="server" 
                             CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" SkinID="Fone"
                             CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" 
                             CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" 
                             TargetControlID="tbxAFax">
                         </act:MaskedEditExtender>
                     </td>
                     <td>
                        <asp:Label ID="lblAEmail"  Text="Email:" runat="server"></asp:Label>
                        <br />
                        <asp:TextBox ID="tbxAEmail" runat="server" Text='<%# Eval("pes_email") %>' SkinID="Email"></asp:TextBox>
                     </td>
                 </tr>
                </table>
                   <table width="50%">
                     <tr>
                        <td>
                           <asp:Label ID="lblACargo" runat="server" Text="Cargo:"></asp:Label>
                           <br />
                           <asp:DropDownList ID="ddlACargo" runat="server" AutoPostBack="True" SkinID="Banco"
                                DataSourceID="odsCargo" DataTextField="car_descricao" SelectedValue='<%# Eval("car_id") %>'
                                DataValueField="car_id" onselectedindexchanged="ddlACargo_SelectedIndexChanged">
                           </asp:DropDownList>
                           <asp:ObjectDataSource ID="odsCargo" runat="server" 
                                OldValuesParameterFormatString="original_{0}" SelectMethod="ObterCargo" 
                                TypeName="SisVenda.Web.Restrito.Fn.CadastroFucionarioFn">
                            </asp:ObjectDataSource>
                        </td>
                        <td>
                            <asp:Label ID="lblACargHoraria" runat="server" Text="Carga Horária:" />
                            <br />
                            <asp:TextBox ID="tbxACargHoraria" runat="server" Text='<%# Eval("car_cargaHoraria") %>' SkinID="CNH" />
                        </td>
                        <td>
                           <asp:Label ID="lblASalarioBase" runat="server" Text="Sálario Base:" />
                           <br />
                           <asp:TextBox ID="tbxASalarioBase" runat="server" Text='<%# Eval("car_salarioBase") %>' SkinID="Valor"></asp:TextBox>
                        </td>
                     </tr>
                   </table>
                      <br />
                      <div class="acoes">
                          <asp:Button ID="btnAlterarEdit" runat="server" CommandName="Update" 
                              SkinID="Salvar" Style="cursor: pointer;" Text="Salvar" 
                              ValidationGroup="update" />
                          &nbsp;&nbsp;<asp:Button ID="btnCancelarEdit" runat="server" CausesValidation="False" 
                              CommandName="Cancel" SkinID="Cancelar" Style="cursor: pointer;" 
                              Text="Cancelar" />
                      </div>
                  </asp:Panel>
                </EditItemTemplate>
                <InsertItemTemplate>
                <asp:Panel ID="pnlNovo" runat="server" GroupingText="Novo">
                   <table width="100%">
                    <tr>
                          <td>
                           <asp:Label ID="lblCPF" runat="server" Text="CPF:"></asp:Label>
                              <br/>
                              <asp:TextBox ID="tbxCPF" runat="server" SkinID="Cpf"></asp:TextBox>
                              <act:MaskedEditExtender ID="tbxCPF_MaskedEditExtender" runat="server" 
                                  CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder=""  SkinID="Cpf"
                                  CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" 
                                  CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" 
                                  TargetControlID="tbxCPF">
                              </act:MaskedEditExtender>
                          </td>
                          <td>
                            <asp:Label ID="lblNome" runat="server" Text="Nome:"></asp:Label>
                              <br/>
                              <asp:TextBox ID="tbxNome" runat="server" SkinID="Nome"></asp:TextBox>
                          </td>
                          <td>
                            <asp:Label ID="lblRg" runat="server" Text="RG:" />
                         <br />
                            <asp:TextBox ID="tbxRG" runat="server" SkinID="RG"></asp:TextBox>
                        </td>
                          <td>
                            <asp:Label ID="lblSexo" runat="server" Text="Sexo:" />
                            <br />
                            <asp:DropDownList ID="ddlSexo" runat="server" SkinID="SEXO" >
                                <asp:ListItem Value="F">Feminino</asp:ListItem>
                                <asp:ListItem Value="M">Masculino</asp:ListItem>
                            </asp:DropDownList>
                         </td>
                          <td>
                            <asp:Label ID="lblDataNasc" runat="server" Text="Data Nascimento:" />
                            <br />
                            <asp:TextBox ID="tbxDataNasci" runat="server" SkinID="Data"></asp:TextBox>
                             <act:CalendarExtender ID="tbxDataNasci_CalendarExtender" runat="server" 
                                 Enabled="True" TargetControlID="tbxDataNasci" Format="dd/MM/yyyy">
                             </act:CalendarExtender>
                        </td>
                    </tr> 
                   </table>
                   <table width="100%">
                    <tr>
                        <td>
                            <asp:Label ID="lblEndereco" runat="server" Text="Endereço:" />
                            <br />
                            <asp:TextBox ID="tbxEndereco" runat="server" SkinID="Nome"></asp:TextBox>
                        </td>
                        <td>
                            <asp:Label ID="lblnumero" runat="server" Text="N°:" />
                            <br />
                            <asp:TextBox ID="tbxNumero" runat="server" SkinID="NumeroPequeno"></asp:TextBox>
                        </td>
                        <td>
                            <asp:Label ID="lblBairro" runat="server" Text="Bairro:" />
                            <br />
                            <asp:TextBox ID="tbxBairro" runat="server" SkinID="Nome"></asp:TextBox>
                        </td>
                        <td>
                            <asp:Label ID="lblUF" runat="server" Text="UF:" />
                            <br />
                            <asp:DropDownList ID="ddlUF" runat="server" AutoPostBack="True" 
                                DataSourceID="odsUF" DataTextField="uf_nome" DataValueField="uf_nome" 
                                onselectedindexchanged="ddlUF_SelectedIndexChanged" SkinID="UF">
                            </asp:DropDownList>
                            <asp:ObjectDataSource ID="odsUF" runat="server" 
                                OldValuesParameterFormatString="original_{0}" SelectMethod="ObterUF" 
                                TypeName="SisVenda.Web.Restrito.Fn.CadastroPessoaFisicaFn">
                            </asp:ObjectDataSource>
                        </td>
                        <td>
                            <asp:Label ID="lblCidade" runat="server" Text="Cidade:" />
                            <br />
                            <asp:DropDownList ID="ddlCidade" runat="server" AutoPostBack="True" 
                                DataSourceID="odsCidade" DataTextField="cid_cidade" 
                                DataValueField="cid_id" SkinID="Cidade">
                            </asp:DropDownList>
                             <asp:ObjectDataSource ID="odsCidade" runat="server" 
                                OldValuesParameterFormatString="original_{0}" SelectMethod="ObterCidadeUF" 
                                TypeName="SisVenda.Web.Restrito.Fn.CadastroPessoaFisicaFn">
                                <SelectParameters>
                                <asp:ControlParameter ControlID="ddlUF" Name="uf_nome" 
                                    PropertyName="SelectedValue" Type="String" />
                                </SelectParameters>
                            </asp:ObjectDataSource>
                        </td>
                     </tr>
                  </table>
                   <table width="100%">
                 <tr>  
                  <td>
                          <asp:Label ID="lblcep"  Text="Cep:" runat="server"></asp:Label>
                          <br />
                          <asp:TextBox ID="tbxCep" runat="server" SkinID="CEP"></asp:TextBox>
                        </td>
                     <td>
                      <asp:Label ID="lblEstadoCivil" runat="server" Text="Estado Civil:" />
                            <br />
                      <asp:DropDownList ID="ddlEstadoCivil" runat="server" SkinID="EstadoCivil">
                      </asp:DropDownList>
                     </td>
                     <td>
                        <asp:Label ID="lblTelefone" runat="server" Text="Telefone:"></asp:Label>
                         <br />
                         <asp:TextBox ID="tbxTelefone" runat="server" SkinID="Telefone"></asp:TextBox>
                         <act:MaskedEditExtender ID="tbxTelefone_MaskedEditExtender" runat="server" 
                             CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" SkinID="Fone"
                             CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" 
                             CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" 
                             TargetControlID="tbxTelefone">
                         </act:MaskedEditExtender>
                     </td>
                     <td>
                        <asp:Label ID="lblCelular" runat="server" Text="Celular:"></asp:Label>
                         <br />
                         <asp:TextBox ID="tbxCeluar" runat="server" SkinID="Telefone"></asp:TextBox>
                         <act:MaskedEditExtender ID="tbxCeluar_MaskedEditExtender" runat="server" 
                             CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" SkinID="Fone"
                             CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" 
                             CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" 
                             TargetControlID="tbxCeluar">
                         </act:MaskedEditExtender>
                     </td>
                     <td>
                        <asp:Label ID="lblFax" runat="server" Text="Fax:"></asp:Label>
                         <br />
                         <asp:TextBox ID="tbxFax" runat="server" SkinID="Telefone"></asp:TextBox>
                         <act:MaskedEditExtender ID="tbxFax_MaskedEditExtender" runat="server" 
                             CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" SkinID="Fone"
                             CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" 
                             CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" 
                             TargetControlID="tbxFax">
                         </act:MaskedEditExtender>
                     </td>
                     <td>
                        <asp:Label ID="lblEmail"  Text="Email:" runat="server"></asp:Label>
                        <br />
                        <asp:TextBox ID="tbxEmail" runat="server" SkinID="Email"></asp:TextBox>
                     </td>
                 </tr>
                </table>
                   <table width="50%">
                     <tr>
                        <td>
                           <asp:Label ID="lblCargo" runat="server" Text="Cargo:"></asp:Label>
                           <br />
                           <asp:DropDownList ID="ddlCargo" runat="server" AutoPostBack="True" SkinID="Banco"
                                DataSourceID="odsCargo" DataTextField="car_descricao" 
                                DataValueField="car_id" onselectedindexchanged="ddlCargo_SelectedIndexChanged">
                           </asp:DropDownList>
                           <asp:ObjectDataSource ID="odsCargo" runat="server" 
                                OldValuesParameterFormatString="original_{0}" SelectMethod="ObterCargo" 
                                TypeName="SisVenda.Web.Restrito.Fn.CadastroFucionarioFn">
                            </asp:ObjectDataSource>
                        </td>
                        <td>
                            <asp:Label ID="lblCargHoraria" runat="server" Text="Carga Horária:" />
                            <br />
                            <asp:TextBox ID="tbxCargHoraria" runat="server" SkinID="CNH" />
                        </td>
                        <td>
                           <asp:Label ID="lblSalarioBase" runat="server" Text="Sálario Base:" />
                           <br />
                           <asp:TextBox ID="tbxSalarioBase" runat="server" SkinID="Valor"></asp:TextBox>
                        </td>
                     </tr>
                   </table>
                  <div class="acoes">
                     <asp:Button ID="btnInserirInsert" runat="server" CommandName="Insert" SkinID="Inserir"
                         Text="Inserir" ValidationGroup="inserir" Style="cursor: pointer;" />
                            &nbsp;&nbsp;<asp:Button ID="btnCancelarInsert" runat="server" CausesValidation="False"
                         CommandName="Cancel" SkinID="Cancelar" Text="Cancelar" Style="cursor: pointer;" 
                         OnClientClick="return confirm('Os valores informados serão descartados e o registro não será inserido. Você confirma o cancelamento da operação?');" />
                            </div>
                 </asp:Panel>
                
                </InsertItemTemplate>
            </asp:FormView>
            <asp:ObjectDataSource ID="odsFormView" runat="server" 
                InsertMethod="InsertPessoa" OldValuesParameterFormatString="original_{0}" 
                SelectMethod="ObterFuncionarioID" 
                TypeName="SisVenda.Web.Restrito.Fn.CadastroFucionarioFn" 
                UpdateMethod="UpdatePessoa" onselecting="odsFormView_Selecting" 
                oninserting="odsFormView_Inserting" oninserted="odsFormView_Inserted" 
                onupdated="odsFormView_Updated" onupdating="odsFormView_Updating">
                <InsertParameters>
                    <asp:Parameter Name="pes_nome" Type="String" />
                    <asp:Parameter Name="pes_cpf" Type="String" />
                    <asp:Parameter Name="pes_rg" Type="String" />
                    <asp:Parameter Name="pes_cnpj" Type="String" />
                    <asp:Parameter Name="pes_inscricaoEstadual" Type="String" />
                    <asp:Parameter Name="pes_sexo" Type="String" />
                    <asp:Parameter Name="pes_tipoPessoa" Type="String" />
                    <asp:Parameter Name="pes_dataNascimento" Type="DateTime" />
                    <asp:Parameter Name="pes_estadoCivil" Type="String" />
                    <asp:Parameter Name="pes_telefone" Type="String" />
                    <asp:Parameter Name="pes_celular" Type="String" />
                    <asp:Parameter Name="pes_fax" Type="String" />
                    <asp:Parameter Name="pes_email" Type="String" />
                    <asp:Parameter Name="end_descricao" Type="String" />
                    <asp:Parameter Name="end_bairro" Type="String" />
                    <asp:Parameter Name="end_numero" Type="Int32" />
                    <asp:Parameter Name="end_cep" Type="String" />
                    <asp:Parameter Name="cid_id" Type="Int32" />
                    <asp:Parameter Name="car_id" Type="Int32" />
                </InsertParameters>
                <SelectParameters>
                    <asp:Parameter Name="fun_id" Type="Int32" />
                </SelectParameters>
                <UpdateParameters>
                    <asp:Parameter Name="func_id" Type="Int32" />
                    <asp:Parameter Name="end_id" Type="Int32" />
                    <asp:Parameter Name="pes_nome" Type="String" />
                    <asp:Parameter Name="pes_cpf" Type="String" />
                    <asp:Parameter Name="pes_rg" Type="String" />
                    <asp:Parameter Name="pes_cnpj" Type="String" />
                    <asp:Parameter Name="pes_inscricaoEstadual" Type="String" />
                    <asp:Parameter Name="pes_sexo" Type="String" />
                    <asp:Parameter Name="pes_tipoPessoa" Type="String" />
                    <asp:Parameter Name="pes_dataNascimento" Type="DateTime" />
                    <asp:Parameter Name="pes_estadoCivil" Type="String" />
                    <asp:Parameter Name="pes_telefone" Type="String" />
                    <asp:Parameter Name="pes_celular" Type="String" />
                    <asp:Parameter Name="pes_fax" Type="String" />
                    <asp:Parameter Name="pes_email" Type="String" />
                    <asp:Parameter Name="end_descricao" Type="String" />
                    <asp:Parameter Name="end_bairro" Type="String" />
                    <asp:Parameter Name="end_numero" Type="Int32" />
                    <asp:Parameter Name="end_cep" Type="String" />
                    <asp:Parameter Name="cid_id" Type="Int32" />
                    <asp:Parameter Name="car_id" Type="Int32" />
                </UpdateParameters>
            </asp:ObjectDataSource>
          
        </ContentTemplate>
     </asp:UpdatePanel>
  </asp:Panel>

</asp:Content>
